<?php $this->load->view('admin/public/head.html', array('css' => array(
'/assets/admin/css/admin/common.css'
))); ?>
<script>
    var pageType = '';
    var attach = {};
</script>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" ng-controller="admin-bbs-index-controller">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            社区管理
            <small>前台用户发帖管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 后台首页</a></li>
            <li class="active">帖子列表</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li ng-class="{'active': page.type == 'all'}" ng-click="switchTab('all')"><a href="javascript:;">全部帖子</a></li>
                        <li ng-repeat="t in bbsTypes"
                            ng-class="{'active': t.key == page.type}"
                            ng-click="switchTab(t.key)"><a href="javascript:;" ng-bind="t.value"></a></li>
                    </ul>
                    <div class="tab-content">

                        <div class="box">
                            <!-- /.box-header -->
                            <div class="box-body no-padding">
                                <table class="table table-striped">
                                    <tr>
                                        <th class="text-center" style="width: 60px">#</th>
                                        <th>内容</th>
                                        <th style="width: 120px;">发布人</th>
                                        <th class="text-center" style="width: 80px;">点赞数</th>
                                        <th class="text-center" style="width: 80px;">评论数</th>
                                        <th class="text-center" style="width: 100px;">创建时间</th>
                                        <th class="text-center" style="width: 80px;">图片附件</th>
                                        <th class="text-center" style="width: 120px">操作</th>
                                    </tr>
                                    <tr ng-repeat="($index, l) in lists">
                                        <td class="text-center" ng-bind="l.bbsId"></td>
                                        <td>
                                            <a href="/bbs/detail/index?bbsId={{ l.bbsId }}" class="text-overflow" ng-bind="(l.content | limitTo: 20) + '...'"></a>
                                        </td>
                                        <td>
                                            <a href="/user/detail/index?id={{ l.userId }}" ng-bind="l.nickName"></a>
                                        </td>
                                        <td class="text-center" ng-bind="l.likes"></td>
                                        <td class="text-center" ng-bind="l.comments"></td>
                                        <td class="text-center" ng-bind="l.created"></td>
                                        <td class="text-center">
                                            <span ng-show="l.attachment.thumb.length > 0" class="fa fa-picture-o text-success"></span>
                                            <span ng-show="l.attachment.thumb.length == 0" class="fa fa-close text-danger"></span>
                                        </td>
                                        <td class="text-center">
                                            <a href="/bbs/detail/index?bbsId={{ l.bbsId }}" class="btn btn-xs btn-link">
                                                <i class="fa-search fa"></i>
                                                查看
                                            </a>
                                            <a href="javascript:void(0);" class="btn btn-xs btn-link" ng-click="removeItem(l.bbsId, $index)">
                                                <i class="fa fa-trash"></i>
                                                删除
                                            </a>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer text-center" ng-show="nextPage">
                                <button class="btn btn-link" ng-click="loadMore()">加载更多</button>
                            </div>
                        </div>
                        <!-- /.box -->

                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array('/assets/admin/js/bbs/index.js'))); ?>
